﻿using System;
using System.Collections.Generic;

namespace FlashPay.Service.Interface
{
    using FlashPay.EF.Models;
    using FlashPay.Entity;
    using FlashPay.Entity.Parameter;
    using FlashPay.Entity.Request;
    using FlashPay.Entity.Request.Menu;
    using FlashPay.Entity.Response.Menu;

    /// <summary>
    /// 菜单业务接口
    /// </summary>
    public interface MenuService
    {
        /// <summary>
        /// 根据编号获取菜单
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns>Menu</returns>
        Menu Get(int id);

        /// <summary>
        /// 更新状态
        /// </summary>
        /// <param name="id">系统编号</param>
        /// <param name="status">状态</param>
        /// <returns></returns>
        bool UpdateStatus(int id, sbyte status);

        /// <summary>
        /// 获取节点列表
        /// </summary>
        /// <param name="id">菜单编号</param>
        /// <returns></returns>
        JResult<List<ZtreeNodesResponse>> GetZtreeNodes(int mType,int? id);

        /// <summary>
        /// 获取子节点列表
        /// </summary>
        /// <param name="parentSysNo">编号</param>
        /// <returns></returns>
        List<ZtreeNodesResponse> GetZtreeChildNodes(int mType, int? parentSysNo);

        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        JResult Delete(DeleteRequest request);

        /// <summary>
        /// 获取节点
        /// </summary>
        /// <param name="id">菜单编号</param>
        /// <returns></returns>
        JResult<MenuResponse> GetMenuNode(int id);

        /// <summary>
        /// 菜单 保存或更新
        /// </summary>
        /// <param name="request">菜单</param>
        /// <param name="privileges">权限</param>
        /// <returns>JsonResult</returns>
        JResult SaveMenu(MenuRequest request, List<int> privileges);

        /// <summary>
        /// 根据条件获取菜单列表
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns>List<Menu></returns>
        List<MenuResponse> GetList(MenuQueryRequest request);

        /// <summary>
        /// 获取菜单列表
        /// </summary>
        /// <param name="ids">系统编号列表</param>
        /// <returns>菜单列表</returns>
        List<Menu> GetListByIds(List<int> ids);

        /// <summary>
        /// 菜单功能权限分页列表
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns></returns>
        PagedList<Permission> GetMenuPermissionPager(MenuPermissionQuery query);
    }
}
